﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
public partial class Login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        if(txtUserName.Text == "admin" && txtPwd.Text=="123")
        {
            FormsAuthentication.SetAuthCookie(txtUserName.Text, false);
            Response.Redirect("Main.aspx");
        }
        else
        {
            Response.Write("<script>alert('输入有误，请重新输入');</script>");
        }
    }
}